home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / smalltlk.zip / PRELUDE / MAGNITUD.ST < prev    next >
Text File  |  1987-06-17  |  512b  |  30 lines

  1. Class Magnitude
  2. [
  3.     <= arg
  4.         ^ (self < arg) or: [self = arg]
  5.  
  6. |    < arg
  7.         ^ (arg > self)
  8.  
  9. |    = arg
  10.         ^ (self > arg or: [self < arg]) not
  11.  
  12. |    ~= arg
  13.         ^ (self = arg) not
  14.  
  15. |    >= arg
  16.         ^ (self > arg) or: [self = arg]
  17.  
  18. |    > arg
  19.         ^ arg < self
  20.  
  21. |    between: low and: high
  22.         ^ (self >= low) and: [self <= high]
  23.  
  24. |    min: arg
  25.         ^ (self < arg) ifTrue: [self] ifFalse: [arg]
  26.  
  27. |    max: arg
  28.         ^ (self > arg) ifTrue: [self] ifFalse: [arg]
  29. ]
  30.